module.exports = function (config) {
    return new Module(config);
};

var Module = function (config) {
    var redis = require('redis');
    // 创建redis客户端

    var redisClient = redis.createClient(config);
    redisClient.on('connect', function () {
        console.log('redis, connect');
    });
    redisClient.on('error', function (error) {
        console.log('redis, error = ' + error);
    });
    redisClient.on('monitor', function (time, args) {
        console.log('redis, monitor = ' + time + '---' +args);
    });
    this.residClient = redisClient;
    return redisClient;
};
